From d797dcc4dd3454d768743702c7094f549bc34315 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 15 Sep 2009 11:04:50 +0200 Subject: [PATCH] Assign the size of the screen to the root window On startup, the root window got assigned the size of the main screen. But, the GdkScreen has the width of all screens/monitors connected to the machine. Change this so that in _gdk_windowing_window_init, we assign the width/height of all monitors to the root window width, height. Should fix bug 594738. --- gdk/quartz/gdkwindow-quartz.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 6b8373b2b9..a7aaf916c2 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -955,16 +955,20 @@ _gdk_windowing_window_init (void) private->impl = g_object_new (_gdk_window_impl_get_type (), NULL); private->impl_window = private; - /* Note: This needs to be reworked for multi-screen support. */ impl = GDK_WINDOW_IMPL_QUARTZ (GDK_WINDOW_OBJECT (_gdk_root)->impl); - rect = [[NSScreen mainScreen] frame]; + /* The size of the root window should be the same as the size of + * the screen it belongs to. + * + * FIXME: Of course this needs to be updated when you change the monitor + * configuration (add another one, remove one, etc). + */ private->x = 0; private->y = 0; private->abs_x = 0; private->abs_y = 0; - private->width = rect.size.width; - private->height = rect.size.height; + private->width = gdk_screen_get_width (_gdk_screen); + private->height = gdk_screen_get_height (_gdk_screen); private->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */ private->window_type = GDK_WINDOW_ROOT; -- 2.30.2